import React, { Component } from 'react'
import Child from './Chlid'

export default class Cat extends Component {
  render () {
    return (
      <div>
        <Child
        // render={position => {
        //   return (
        //     <div>
        //       <img
        //         src='https://img0.baidu.com/it/u=4281426283,1277150239&fm=253&fmt=auto&app=138&f=JPEG?w=667&h=500'
        //         alt=''
        //         style={{
        //           width: 100,
        //           height: 80,
        //           position,
        //           position: 'absolute',
        //           left: position.x,
        //           top: position.y
        //         }}
        //       />
        //     </div>
        //   )
        // }}
        >
          {position => {
            return (
              <div>
                <img
                  src='https://img0.baidu.com/it/u=4281426283,1277150239&fm=253&fmt=auto&app=138&f=JPEG?w=667&h=500'
                  alt=''
                  style={{
                    width: 100,
                    height: 80,
                    position,
                    position: 'absolute',
                    left: position.x,
                    top: position.y
                  }}
                />
              </div>
            )
          }}
        </Child>
      </div>
    )
  }
}
